home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / ds5000.md / RCS / filehdr.h,v < prev    next >
Encoding:
Text File  |  1990-02-16  |  8.2 KB  |  300 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     90.02.16.12.53.37;  author douglis;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     89.08.01.15.38.17;  author douglis;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @original ultrix version
  22. @
  23.  
  24.  
  25. 1.2
  26. log
  27. @use sprite format with ifndefs at starts of files
  28. @
  29. text
  30. @/*
  31.  * $Header: /sprite/lib/forms/RCS/proto.h,v 1.2 89/01/07 04:12:44 rab Exp $ SPRITE (Berkeley)
  32.  */
  33.  
  34. #ifndef _FILEHDR
  35. #define _FILEHDR
  36.  
  37. /*    @@(#)filehdr.h    4.1    (ULTRIX)    8/9/88                      */
  38. #ifdef mips
  39. /* ------------------------------------------------------------------ */
  40. /* | Copyright Unpublished, MIPS Computer Systems, Inc.  All Rights | */
  41. /* | Reserved.  This software contains proprietary and confidential | */
  42. /* | information of MIPS and its suppliers.  Use, disclosure or     | */
  43. /* | reproduction is prohibited without the prior express written   | */
  44. /* | consent of MIPS.                                               | */
  45. /* ------------------------------------------------------------------ */
  46.  
  47. /*    Copyright (c) 1984 AT&T    */
  48. /*      All Rights Reserved      */
  49.  
  50. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  51. /*    The copyright notice above does not evidence any       */
  52. /*    actual or intended publication of such source code.    */
  53.  
  54. #ifdef mips
  55. /*
  56.  * The field f_symptr now is a file pointer to the symbolic header which was
  57.  * the file pointer to symtab.  The field f_nsyms is now the size of the
  58.  * symbolic header which was number of symtab entries.
  59.  */
  60. #endif /* mips */
  61.  
  62. #ifdef LANGUAGE_C
  63. struct filehdr {
  64.     unsigned short    f_magic;    /* magic number */
  65.     unsigned short    f_nscns;    /* number of sections */
  66.     long        f_timdat;    /* time & date stamp */
  67.     long        f_symptr;    /* file pointer to symbolic header */
  68.     long        f_nsyms;    /* sizeof(symbolic hdr) */
  69.     unsigned short    f_opthdr;    /* sizeof(optional hdr) */
  70.     unsigned short    f_flags;    /* flags */
  71.     };
  72. #endif /* LANGUAGE_C */
  73.  
  74. #ifdef LANGUAGE_PASCAL
  75. type
  76.   filehdr = packed record
  77.       f_magic : ushort;         /* magic number              */
  78.       f_nscns : ushort;         /* number of sections             */
  79.       f_timdat : long;            /* time & date stamp             */
  80.       f_symptr : long;            /* file pointer to symbolic header   */
  81.       f_nsyms : long;            /* sizeof(symbolic hdr)          */
  82.       f_opthdr : ushort;        /* sizeof(optional hdr)          */
  83.       f_flags : ushort;         /* flags                 */
  84.     end {record};
  85. #endif /* LANGUAGE_PASCAL */
  86.  
  87. /*
  88.  *   Bits for f_flags:
  89.  *
  90.  *    F_RELFLG    relocation info stripped from file
  91.  *    F_EXEC        file is executable  (i.e. no unresolved
  92.  *                externel references)
  93.  *    F_LNNO        line nunbers stripped from file
  94.  *    F_LSYMS        local symbols stripped from file
  95.  *    F_MINMAL    this is a minimal object file (".m") output of fextract
  96.  *    F_UPDATE    this is a fully bound update file, output of ogen
  97.  *    F_SWABD        this file has had its bytes swabbed (in names)
  98.  *    F_AR16WR    this file has the byte ordering of an AR16WR (e.g. 11/70) machine
  99.  *                (it was created there, or was produced by conv)
  100.  *    F_AR32WR    this file has the byte ordering of an AR32WR machine(e.g. vax)
  101.  *    F_AR32W        this file has the byte ordering of an AR32W machine (e.g. 3b,maxi,MC68000)
  102.  *    F_PATCH        file contains "patch" list in optional header
  103.  *    F_NODF        (minimal file only) no decision functions for
  104.  *                replaced functions
  105.  */
  106.  
  107. #ifdef LANGUAGE_C
  108. #define  F_RELFLG    0000001
  109. #define  F_EXEC        0000002
  110. #define  F_LNNO        0000004
  111. #define  F_LSYMS    0000010
  112. #define  F_MINMAL    0000020
  113. #define  F_UPDATE    0000040
  114. #define  F_SWABD    0000100
  115. #define  F_AR16WR    0000200
  116. #define  F_AR32WR    0000400
  117. #define  F_AR32W    0001000
  118. #define  F_PATCH    0002000
  119. #define  F_NODF        0002000
  120. #endif /* LANGUAGE_C */
  121.  
  122. #ifdef LANGUAGE_PASCAL
  123. #define  F_RELFLG    16#0001
  124. #define  F_EXEC        16#0002
  125. #define  F_LNNO        16#0004
  126. #define  F_LSYMS    16#0008
  127. #define  F_MINMAL    16#0010
  128. #define  F_UPDATE    16#0020
  129. #define  F_SWABD    16#0040
  130. #define  F_AR16WR    16#0080
  131. #define  F_AR32WR    16#0100
  132. #define  F_AR32W    16#0200
  133. #define  F_PATCH    16#0400
  134. #define  F_NODF        16#0400
  135. #endif /* LANGUAGE_PASCAL */
  136.  
  137. /*
  138.  *    BELLMAC-32    Identification field
  139.  *    F_BM32B        file contains BM32B code (as opposed to strictly BM32A)
  140.  *    F_BM32MAU    file requires MAU (math arith unit) to execute
  141.  */
  142.  
  143. #define    F_BM32ID    0160000
  144. #define    F_BM32MAU    0040000
  145. #define F_BM32B         0020000
  146.  
  147. /*    F_BM32RST    file has RESTORE work-around    */
  148. #define F_BM32RST    0010000
  149.  
  150. /*
  151.  *    Flags for the INTEL chips.  If the magic number of the object file
  152.  *    is IAPX16 or IAPX16TV or IAPX20 or IAPX20TV then if F_80186
  153.  *    is set, there are some 80186 instructions in the code, and hence
  154.  *    and 80186 or 80286 chip must be used to run the code.
  155.  *    If F_80286 is set, then the code has to be run on an 80286 chip.
  156.  *    And if neither are set, then the code can run on an 8086, 80186, or
  157.  *    80286 chip.
  158.  *
  159.  */
  160.  
  161. #define F_80186        010000
  162. #define F_80286        020000
  163.  
  164. /*
  165.  *   Magic Numbers
  166.  */
  167.  
  168.     /* iAPX - the stack frame and return registers differ from
  169.      *       Basic-16 and x86 C compilers, hence new magic numbers
  170.      *      are required.  These are cross compilers.
  171.      */
  172.  
  173.     /* Intel */
  174. #define  IAPX16        0504
  175. #define  IAPX16TV    0505
  176. #define  IAPX20        0506
  177. #define  IAPX20TV    0507
  178. /* 0514, 0516 and 0517 reserved for Intel */
  179.  
  180.     /* mips */
  181. #ifdef LANGUAGE_C
  182. #define  MIPSEBMAGIC    0x0160
  183. #define  MIPSELMAGIC    0x0162
  184. #define  SMIPSEBMAGIC    0x6001
  185. #define  SMIPSELMAGIC    0x6201
  186. #define  MIPSEBUMAGIC    0x0180
  187. #define  MIPSELUMAGIC    0x0182
  188. #endif /* LANGUAGE_C */
  189. #ifdef LANGUAGE_PASCAL
  190. #define  MIPSEBMAGIC    16#0160
  191. #define  MIPSELMAGIC    16#0162
  192. #define  SMIPSEBMAGIC    16#6001
  193. #define  SMIPSELMAGIC    16#6201
  194. #define  MIPSEBUMAGIC    16#0180
  195. #define  MIPSELUMAGIC    16#0182
  196. #endif /* LANGUAGE_PASCAL */
  197.  
  198.     /* Basic-16 */
  199. #define  B16MAGIC    0502
  200. #define  BTVMAGIC    0503
  201.  
  202.     /* x86 */
  203. #define  X86MAGIC    0510
  204. #define  XTVMAGIC    0511
  205.  
  206.     /* Intel 286 */
  207. #define I286SMAGIC    0512
  208. #define I286LMAGIC    0522    /* used by mc68000 (UNIX PC) and iAPX 286 */
  209.  
  210.     /* n3b */
  211. /*
  212.  *   NOTE:   For New 3B, the old values of magic numbers
  213.  *        will be in the optional header in the structure
  214.  *        "aouthdr" (identical to old 3B aouthdr).
  215.  */
  216. #define  N3BMAGIC    0550    /* 3B20 executable, no TV */
  217. #define  NTVMAGIC    0551    /* 3B20 executable with TV */
  218.  
  219.     /*  XL  */
  220. #define     XLMAGIC    0540
  221.  
  222.     /*  MAC-32, 3B15, 3B5  */
  223. #define  WE32MAGIC    0560    /* WE 32000, no TV */
  224. #define  FBOMAGIC    0560    /* WE 32000, no TV */
  225. #define  RBOMAGIC    0562    /* reserved for WE 32000 */
  226. #define  MTVMAGIC    0561    /* WE 32000 with TV */
  227.  
  228.     /* VAX 11/780 and VAX 11/750 */
  229.  
  230.             /* writeable text segments */
  231. #define VAXWRMAGIC    0570
  232.             /* readonly sharable text segments */
  233. #define VAXROMAGIC    0575
  234.  
  235.     /* pdp11 */
  236. /*            0401    UNIX-rt ldp */
  237. /*            0405    pdp11 overlay */
  238. /*            0407    pdp11/pre System V vax executable */
  239. /*            0410    pdp11/pre System V vax pure executable */
  240. /*            0411    pdp11 seperate I&D */
  241. /*            0437    pdp11 kernel overlay */
  242.  
  243.  
  244.     /* Motorola 68000/68008/68010/68020 */
  245. #define    MC68MAGIC    0520
  246. #define MC68KWRMAGIC    0520    /* writeable text segments */
  247. #define    MC68TVMAGIC    0521
  248. #define MC68KROMAGIC    0521    /* readonly shareable text segments */
  249. #define MC68KPGMAGIC    0522    /* demand paged text segments */
  250. #define    M68MAGIC    0210
  251. #define    M68TVMAGIC    0211
  252.  
  253.  
  254.     /* IBM 370 */
  255. #define    U370WRMAGIC    0530    /* writeble text segments    */
  256. #define    U370ROMAGIC    0535    /* readonly sharable text segments    */
  257. /* 0532 and 0533 reserved for u370 */
  258.  
  259.     /* Amdahl 470/580 */
  260. #define AMDWRMAGIC    0531    /* writable text segments */
  261. #define AMDROMAGIC    0534    /* readonly sharable text segments */
  262.  
  263.     /* NSC */
  264. /* 0524 and 0525 reserved for NSC */
  265.  
  266.     /* Zilog */
  267. /* 0544 and 0545 reserved for Zilog */
  268.  
  269. #define    FILHDR    struct filehdr
  270. #define    FILHSZ    sizeof(FILHDR)
  271.  
  272. #define ISCOFF(x) \
  273.         (((x)==B16MAGIC) || ((x)==BTVMAGIC) || ((x)==X86MAGIC) \
  274.         || ((x)==XTVMAGIC) || ((x)==N3BMAGIC) || ((x)==NTVMAGIC) \
  275.         || ((x)==FBOMAGIC) || ((x)==VAXROMAGIC) || ((x)==VAXWRMAGIC) \
  276.         || ((x)==RBOMAGIC) || ((x)==MC68TVMAGIC) \
  277.         || ((x)==MC68MAGIC) || ((x)==M68MAGIC) || ((x)==M68TVMAGIC) \
  278.         || ((x)==IAPX16) || ((x)==IAPX16TV) \
  279.         || ((x)==IAPX20) || ((x)==IAPX20TV) \
  280.         || ((x)==MIPSEBMAGIC) || ((x)==MIPSELMAGIC) \
  281.         || ((x)==SMIPSEBMAGIC) || ((x)==SMIPSELMAGIC) \
  282.         || ((x)==MIPSEBUMAGIC) || ((x)==MIPSELUMAGIC) \
  283.         || ((x)==U370WRMAGIC) || ((x)==U370ROMAGIC) || ((x)==MTVMAGIC) \
  284.         || ((x)==I286SMAGIC) || ((x)==I286LMAGIC) \
  285.         || ((x)==MC68KWRMAGIC) || ((x)==MC68KROMAGIC) \
  286.         || ((x)==MC68KPGMAGIC))
  287. #endif /* mips */
  288. #endif /* _FILEHDR */
  289. @
  290.  
  291.  
  292. 1.1
  293. log
  294. @Initial revision
  295. @
  296. text
  297. @d1 7
  298. d259 1
  299. @
  300.